<template lang="">
    <div>
        <ul>
            <li v-for="m in messageList" :key="m.id">
                <!-- 跳转路由并携带parmas参数，to的字符串写法 -->
                <!-- <router-link :to='`/home/message/detail/${m.id}/${m.msg}`'>{{m.msg}}</router-link> -->
            
                <!-- 跳转路由并携带params参数，to的字符串写法 -->
                <router-link :to="{
                    //path:'/home/message/detail',
                    name:'xiangxi',
                    params:{
                        id:m.id,
                        msg:m.msg
                    }
                }">{{m.msg}}</router-link>
            </li>
        </ul>
        <router-view></router-view>
    </div>
</template>
<script>
export default {
    name:'Message',
    data() {
        return {
            messageList:[
                {id:'001',msg:'消息一001'},
                {id:'002',msg:'消息一002'},
            ]
        }
    },
}
</script>
<style lang="">
    
</style>